package com.example.gfsquadwebviewproject.data.setting;

import android.content.Context;

import com.example.gfsquadwebviewproject.data.Constant;
import com.example.gfsquadwebviewproject.data.PreferenceKey;
import com.example.gfsquadwebviewproject.util.PreferencesUtils;

public class MqttConfigData {

    String mqtt_ip;
    int mqtt_port;

    Context context;

    public MqttConfigData(Context context) {
        this.context = context;
    }


    public String getMqtt_ip() {
        mqtt_ip = PreferencesUtils.getString(context, PreferenceKey.MQTT_IP, Constant.addr);
        return mqtt_ip;
    }

    public void setMqtt_ip(String mqtt_ip) {
        PreferencesUtils.putString(context, PreferenceKey.MQTT_IP,mqtt_ip);
        this.mqtt_ip = mqtt_ip;
    }

    public int getMqtt_port() {
        mqtt_port = PreferencesUtils.getInt(context, PreferenceKey.MQTT_PORT,1883);
        return mqtt_port;
    }

    public void setMqtt_port(int mqtt_port) {
        PreferencesUtils.putInt(context, PreferenceKey.MQTT_PORT,mqtt_port);
        this.mqtt_port = mqtt_port;
    }
}
